/// @tags: DP
#include <algorithm>
#include <cstdio>
#include <iostream>

using std::cin;
using std::cout;

namespace BlueQuantum {

constexpr int MAXN = 1e2 + 3, MAXM = 2e4 + 3;

int s, n, m;
int a[MAXN][MAXN], f[MAXN][MAXM];

inline int main() {
  cin >> s >> n >> m;
  for (int j = 1; j <= s; ++j) {
    for (int i = 1; i <= n; ++i) {
      cin >> a[i][j];
      a[i][j] *= 2;
      a[i][j]++;
    }
  }
  for (int i = 1; i <= n; ++i) std::sort(a[i] + 1, a[i] + s + 1);
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j <= s; ++j)
      for (int k = a[i][j]; k <= m; ++k) {
        f[i][k] = std::max(f[i][k], f[i - 1][k - a[i][j]] + i * j);
      }
  }
  int ans = 0;
  for (int i = 0; i <= m; ++i) ans = std::max(ans, f[n][i]);
  cout << ans;
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("P5322 [BJOI2019] 排兵布阵.in", "r", stdin);
  freopen("P5322 [BJOI2019] 排兵布阵.out", "w", stdout);
#endif
#endif

  std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
